<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>THẾ GIỚI LINH KIỆN MÁY TÍNH-XUÂN TUẤN</title>
</head>

<body background="img/page_bg.png">
<div align="center">
<form method="post"  name="fr"  action="dangnhap1.php" Onsubmit="return CheckInput1();">
<br />
<p><h1><marquee width="433">
<font color="#0000CC">Không Phận Sự Miễn Đăng Nhập</font>
<img src="img/a_201147113723_fast.gif" width="130" height="100" />
</marquee>
</h1>
</p>

<table width="433" border="1" bordercolor="#000000">
  <tr>
    <td height="53" colspan="2"  bgcolor="#FFFFFF"><div align="center"><font color="#0000CC" size="+2"><b>Đăng nhập Quản trị</b></font></div></td>
    </tr>
  <tr>
    <td width="166" height="32"><div align="left">Tên đăng nhập:</div></td>
    <td width="251"><input name="ten" type="text" size="30" /></td>
  </tr>
  <tr>
    <td height="38"><div  align="left">Mật khẩu:</div></td>
    <td><input name="mk" type="password" size="30" /></td>
  </tr>
  <tr>
    <td  height="48"><div align="center"><input type="submit" name="dn" value="  Đăng Nhập  " /></div></td>
    <td><input type="submit" name="xoa" value="  Xóa  " /></td>
  </tr>
</table>
  
<p>&nbsp;</p>
</form>
<?php 
error_reporting(0); 
if ($_REQUEST["dn"]!="")
{
	$ten=$_REQUEST['ten'];
	$mk=$_REQUEST['mk'];
	
	$con=mysql_connect("localhost","root","");
	mysql_select_db("linhkienmt",$con);
  $sql="select * from admin where ten='".$ten."' and mk ='".$mk."'";
  $kq=mysql_query($sql,$con);
   $n=mysql_num_rows($kq);
		if  ($n != 0)
   { $a=mysql_fetch_array($kq); 
	$_SESSION["hoten"]=$a['ten'];
   ?>
     <script language="javascript">
			window.location.href='quantri/indexquantri.php';
		</script>
	<?php }
   else
  { ?>  
		
		<script language="javascript">
		 alert ("Đăng nhập không thành công. Vui lòng kiểm tra lại..!");	
			window.location.href='dangnhap1.php';
		</script><?php }
	 
	
	mysql_close($con);}
	?>	
</div></body>
</html>